import JSEncrypt from "jsencrypt";

const publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDeA4C3hUsmxDrzBLPI48ahMryslnwzGQ11HdaONWQBW5d+EkHu6ayYpHbFs9+c+qePwsqE6DmFaFo7TMLe9v73cgzT0TftO89u9f+lDgAyFxITLl7uGMu9RdMNDIgn1jw6GR2CvxCzXtjMzBiLAS7S1s4peJf6zS4tKItvEsTlQIDAQAB";

export function encrypt(str) {
    var encrypt = new JSEncrypt();
    encrypt.setPublicKey(publicKey);
    var encrypted = encrypt.encrypt(str);
    return encrypted;
}